use std::path::PathBuf;

/// 通知agent更新的结构体
#[derive(Debug, Clone)]
pub struct ModifyMsg {
    /// 文件在server本地的绝对路径
    pub file_path_server: PathBuf,
    /// 文件在agent本地的绝对路径
    pub file_path_agent: PathBuf,
    /// 文件的变更类型，只有Deleted, Added, Modified三种
    pub delta: git2::Delta,
}

impl ModifyMsg {
    pub fn new(file_path_server: PathBuf, file_path_agent: PathBuf, delta: git2::Delta) -> Self {
        ModifyMsg {
            file_path_server,
            file_path_agent,
            delta,
        }
    }
}
